package com.geeguo.ebuilder.client.base.tenant.remote.fallback;

import com.geeguo.ebuilder.client.base.tenant.model.TenantInfoRO;
import com.geeguo.ebuilder.client.base.tenant.remote.TenantInfoApi;
import com.geeguo.ebuilder.core.common.action.ActionResult;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;

import lombok.extern.slf4j.Slf4j;

import java.util.List;

@Slf4j
@Component
public class TenantInfoApiFallback implements TenantInfoApi {

    @Override
    public ActionResult<List<TenantInfoRO>> listValid() {
        log.error("从运营中心获取启用租户信息失败。");
        return ActionResult.fail("从运营中心获取启用租户信息失败。");
    }

    @Override
    public ActionResult<TenantInfoRO> getByCode(String code) {
        log.error("从运营中心获取租户信息失败，租户编码：" + code + "。");
        return ActionResult.fail("从运营中心获取租户信息失败。");
    }

    @Override
    public ActionResult<TenantInfoRO> getByDomain(@PathVariable("domain") String domain) {
        log.error("从运营中心获取租户信息失败，租户域名：" + domain + "。");
        return ActionResult.fail("从运营中心获取租户信息失败。");
    }
}